package com.dsh.controller;

import com.dsh.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

@RestController
@RequestMapping("search")
public class SearchController {
    @Autowired
    SearchService searchService;

    @RequestMapping("{page}/{size}")
    public Map search(@PathVariable Integer page, @PathVariable Integer size, @RequestBody Map map) throws IOException {
        return searchService.search (page,size,map);
    }
}
